<!doctype html>
<html lang="cn">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link href="/res/inspinia/css/bootstrap.min.css" rel="stylesheet">
    <link href="/res/inspinia/font-awesome/css/font-awesome.css" rel="stylesheet">
    <!-- bootstrap-table-->
    <link href="/res/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">

    <link href="/res/inspinia/css/animate.css" rel="stylesheet">
    <link href="/res/inspinia/css/style.css" rel="stylesheet">


    <title>发票</title>
</head>
<body class="mini-navbar fixed-sidebar">
<div id="wrapper">

    <div id="page-wrapper" class="gray-bg">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-12">
                    <div class="ibox ">
                        <div class="ibox-title">
                            <h5>发票列表</h5>
                        </div>
                        <div class="ibox-content">
                            <div class="row">
                                <div class="col">
                                    <table id="invoiceList_table" class="table table-striped"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Mainly scripts -->
<script src="/res/inspinia/js/jquery-3.1.1.min.js"></script>
<script src="/res/inspinia/js/popper.min.js"></script>
<script src="/res/inspinia/js/bootstrap.js"></script>
<script src="/res/inspinia/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/res/inspinia/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- Custom and plugin javascript -->
<script src="/res/inspinia/js/inspinia.js"></script>
<script src="/res/inspinia/js/plugins/pace/pace.min.js"></script>
<!--bootstrap-table-->
<script src="/res/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/res/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript">
    $().ready(function () {
        invoiceListObj.initTable();
    })
    const invoiceListObj = new Object({
        initTable: function () {
            $('#invoiceList_table').bootstrapTable({
                pagination: true,
                sidePagination: 'server',
                url: '/invoice/invoicedetail/list',
                queryParamsType: '',
                formatNoMatches: function () {  //没有匹配的结果
                    return '暂无数据';
                },
                queryParams: function (param) {
                    param.recordCode = "[[${recordCode}]]";
                    param.page = param.pageNumber;
                    param.limit = param.pageSize;
                    return param;
                },
                columns: [{
                    title: '#',
                    align: 'center',
                    width: 50,
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                }, {
                    title: '发票代码',
                    field: 'code'
                }, {
                    title: '发票号码',
                    field: 'number'
                }],
                responseHandler: function (res) {
                    return {
                        total: res.page.totalCount,
                        rows: res.page.list
                    };
                }
            });
        }
    })
</script>
</body>
</html>